package iohomework;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class PWDemo02 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos=new FileOutputStream("note.dat");
        PrintWriter pw=new PrintWriter(fos,true);
        Scanner scan=new Scanner(System.in);
        while(true){
            System.out.println("请输入要做的事，单独输入exit退出");
            String line=scan.nextLine();
            if("exit".equals(line)){
                break;
            }
            pw.println(line);
        }
        pw.close();
        System.out.println("退出成功");
    }
}
